
def main():
   myMessage = '汉献帝被困洛阳，现要传输一个信息出洛阳，内容如下：“朕乃大汉天子，被某贼困于洛阳，朕令天下英豪并起勤王，匡扶汉室于危难之中'
   myKey = 9
   ciphertext = encryptMessage(myKey,myMessage)
   print("Cipher Text is")
   print(ciphertext + '|')

def encryptMessage(key,message):
   ciphertext = [''] * key
   for col in range(key):
      position = col
      while position < len(message):
         ciphertext[col] += message[position]
         position += key
   return ''.join(ciphertext) #Cipher text
  
if __name__ == '__main__':
    main()
    
